//
//  HPRepostViewController.m
//  HonlivApp
//
//  Created by admin on 2017/7/19.
//  Copyright © 2017年 honliv. All rights reserved.
//

#import "HPRepostViewController.h"

static NSString *const reportHTTP = @"http://joker1011.applinzi.com/";
static NSString *const SEcode = @"1.1.3.01";

//医院报表，获取权限为20
static NSString *const report_HY = @"http://joker1011.applinzi.com/医院年报/index.html";

//科室报表{db:"honlivapiframe",SqlNo:"75",YGBH:"1"};获得该主任的科室代码’1.1.1.04’
static NSString *const report_SY = @"http://joker1011.applinzi.com/科室年报/index.html?1.1.1.04&1.1.3.01";



@interface HPRepostViewController ()

@property (nonatomic,copy) NSString *reportUrl;

@end

@implementation HPRepostViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = self.reportName;
   
}
-(void)viewDidAppear:(BOOL)animated{
     self.webView.frame = CGRectMake(0, 0, kScreenW, kScreenH-64);
}
-(void)getRequestURL{
    [self loadRequestURL:^(GetURL handler) {
        switch (self.type) {
            case ReportTypePersonal:
                _reportUrl = [NSString stringWithFormat:@"%@%@/index.html?%@",reportHTTP,self.reportName,[User currentUser].userId];
                break;
            case ReportTypeHospital:
                _reportUrl = [NSString stringWithFormat:@"%@%@/index.html",reportHTTP,self.reportName];
                break;
            case ReportTypeSubject:
                _reportUrl = [NSString stringWithFormat:@"%@%@/index.html?%@&1.1.3.01",reportHTTP,self.reportName,self.visitId];
                break;
            default:{
            }
                break;
        }
        NSString *urlStringUTF8 = [_reportUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        handler(urlStringUTF8);
    }];
}


@end
